
import AppFooter from "@/layout/AppFooter.vue"

import HomeView from "@/views/Home/index.vue";
import CategoryView from "@/views/Category/index.vue";
import CarView from "@/views/Car/index.vue";
import DetailView from "@/views/Detail/index.vue";
import MineView from "@/views/Mine/index.vue";
import RegisterView from "@/views/Register/index.vue";
import LoginView from "@/views/Login/index.vue";
import NotFoundView from "@/views/NotFound/index.vue";

const routes = [
    {
        path: '/',
        name: 'home',
        components: {
            default:HomeView,
            footer:AppFooter
        }
    },
    {
        path: "/category",
        name: "category",
        // component: CategoryView,
        components: {
            default:CategoryView,
            footer:AppFooter
        }
    },
    {
        path: "/detail",
        name: "detail",
        meta: { title: "详情", isBack: true },
        component: DetailView,
    },
    
    {
        path: "/car",
        name: "car",
        // component: CarView
        components: {
            default:CarView,
            footer:AppFooter
        }
    },
    {
        path: "/mine",
        name: "mine",
        // component: MineView,
        components: {
            default:MineView,
            footer:AppFooter
        }
    },
    {
        path: "/register",
        name:"register",
        component: RegisterView
    },
    {
        path: "/login",
        name:"login",
        component: LoginView
    },
    {
        path: "/404",
        name:"not-found",
        component: NotFoundView
    },
    {
        path:"/:pathMatch(.*)*",
        redirect:"/404",
    }
]

export default routes;